import {createRouter, createWebHistory} from 'vue-router'

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [
        {path: '/', redirect: '/manager/home'},
        {
            path: '/manager', component: () => import('../views/Manager.vue'),
            children: [
                {path: 'admin', meta: {name: '用户信息'}, component: () => import('../views/Admin.vue')},
                {path: 'home', meta: {name: '主页'}, component: () => import('../views/Home.vue')},
                {path: 'student', meta: {name: '学生信息'}, component: () => import('../views/Student.vue')},
                {path: 'exam', meta: {name: '考试信息'}, component: () => import('../views/Exam.vue')},
                {path: 'scores', meta: {name: '成绩分析'}, component: () => import('../views/Scores.vue')},
                {path: 'fenxi', meta: {name: '积分计算'}, component: () => import('../views/Fenxi.vue')},
                {path: 'seat', meta: {name: '座位工具'}, component: () => import('../views/Seat.vue')}
            ]
        },
        {path: '/login', component: () => import('../views/Login.vue')},
        {path: '/register', component: () => import('../views/Register.vue')},
        {path: '/notFound', component: () => import('../views/404.vue')},
        {path: '/:pathMatch(.*)', redirect: '/notFound'}
    ],
})

export default router
